package GameMain.View.PlayerBag
{
	import Engine.Module.ModuleBase;
	
	import GameMain.Game;
	import GameMain.UIControl.ItemIcon;
	
	import flash.display.LoaderInfo;
	import flash.display.Sprite;
	
	import library.Function.Dict;
	
	public class PlayerBag extends ModuleBase
	{
		
		private var itemDict:Dict = new Dict();
		
		public function PlayerBag(p_content:Sprite,info:LoaderInfo)
		{
			super(p_content);
			this.x = 75;this.y = 11;
			Game.ControlMgr.getButton(this._content["CLOSE_BTN"]).setOnClickFun(this.dispose);
			ItemIcon.setDefaultIcon(info.applicationDomain.getDefinition("Fla.DefaultIcon") as Class);
			this.initUI();
		}
		
		private function initUI():void
		{
			var posx:Number = 458.35; var posy:Number = 86.8;
			var item:ItemIcon;var itemIndex:int = 1;
			/*初始化背包装备*/
			for(var i:int = 0;i<7;i++)
			{
				for(var j:int = 0;j<7;j++)
				{
					itemIndex++;
					item = new ItemIcon(itemIndex);
					item.x = posx + j*(item.width+9);
					item.y = posy + i*(item.width+7);
					this.addChild(item.content);
					itemDict.dictionary[itemIndex] = item;
				}
			}
		}
		
	}
}